import { createRouter, createWebHistory } from 'vue-router'
import FurnitureList from '../components/FurnitureList.vue'
import FurnitureDetail from '../components/FurnitureDetail.vue'
import BookingForm from '../components/BookingForm.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: FurnitureList
  },
  {
    path: '/detail/:id',
    name: 'detail',
    component: FurnitureDetail,
    props: true
  },
  {
    path: '/booking/:id?',
    name: 'booking',
    component: BookingForm,
    props: true
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router